<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace App\Info\Request;

use Mine\MineFormRequest;

/**
 * 广告表验证数据类
 */
class InfoAdvRequest extends MineFormRequest
{
    /**
     * 公共规则
     */
    public function commonRules(): array
    {
        return [];
    }

    
    /**
     * 新增数据验证规则
     * return array
     */
    public function saveRules(): array
    {
        return [
            //广告位id 验证
            'ap_id' => 'required',
            //广告内容描述 验证
            'adv_title' => 'required',
            //广告内容 验证
            'adv_content' => 'required',
            //幻灯片排序 验证
            'order_sort' => 'required',
            //广告点击率 验证
            'click_num' => 'required',
            //会员购买的广告是否通过审核0未审核1审核已通过2审核未通过 验证
            'is_allow' => 'required',

        ];
    }
    /**
     * 更新数据验证规则
     * return array
     */
    public function updateRules(): array
    {
        return [
            //广告位id 验证
            'ap_id' => 'required',
            //广告内容描述 验证
            'adv_title' => 'required',
            //广告内容 验证
            'adv_content' => 'required',
            //幻灯片排序 验证
            'order_sort' => 'required',
            //广告点击率 验证
            'click_num' => 'required',
            //会员购买的广告是否通过审核0未审核1审核已通过2审核未通过 验证
            'is_allow' => 'required',

        ];
    }

    
    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => '广告自增标识编号',
            'ap_id' => '广告位id',
            'adv_title' => '广告内容描述',
            'adv_content' => '广告内容',
            'order_sort' => '幻灯片排序',
            'click_num' => '广告点击率',
            'is_allow' => '会员购买的广告是否通过审核0未审核1审核已通过2审核未通过',

        ];
    }

}